// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require(CONFIG.BasePath + "js/enterprise/base");
	var router = require("../hash/pageRouter");
	var footer = require("../footer/footer_gray");
	var top = require("../top/top_main");
	var constant = require("constant");
	var databind = require("databind");
	var dialog = require("dialog");
	var css_loan = require("./myLoan.css");
	var flag = false;
	var tools = require("tools");
	var pageIndex = 1,
		pageSize = 10,
		totalPageCount = 1,
		totalRecordCount = 0; //分页初始化
	var tools = require("tools");
	var init = function() {
		router.init();
		initEvent();
	};

	var initEvent = function() {
		if (base.getData("sid") == null) {
			location.href = "../login/login.html";
		};

		tools.loadList("inquireFinanceCreditPageList.json", $("#myReplenishTable"), $("#myReplenishTpl"), {
			"adjustment": 3,
			"auditState": 2
		}, function() {
			$(".applicationDetail").unbind("click").click(function(){
				router.route("account/accountDetail.html?financeId="+ $(this).parents("tr").attr("financeId"));
			});
			
			$(".detail").unbind("click").click(function(){
				router.route("account/myReplenishDetail.html?creditId="+ $(this).parents("tr").attr("creditId"));
			});
		});
	};

	return {
		init: init
	};
});